BlitImageAlphaAddColour
BlitImageAlphaAddColour ThisImage, Xpos, Ypos, BlendColour
 
Parameters:

    ThisImage = The Index of the image you wish to draw
    Xpos = The X coordinate to draw this image
    Ypos = The Y coordinate to draw this image
    BlendColour = The RGB Colour to blend this surface after it's been drawn
Returns: NONE
 

     BlitImageAlphaAddColour is similar to the DrawImage function, except it has post processing. What it does, is it draws your selected image, but it also performs a Alpha Colour Addition on the image with your selected colour. So it's the equivalent using DrawImage to first draw the image as is, then going back drawing a BOX with an AlphaAdd InkMode over the image..

      The combined processing is not just to save you a few lines of code, it's actually a more optimal way of performing this action.



FACTS:


     * BlitImageAlphaAddColour alters the source image.

     * BlitImageAlphaAddColour is only intend for drawing FX or AFX formatted surfaces.

     * BlitImageAlphaAddColour doesn't support mask & alpha channel transparency.



 
Example Source: Download This Example
; Inlude the Blit Image functions
  #Include "BlitImage"
  
; Create an FX image the size of the screen
  MyImage=NewFXImage(GetScreenWidth(),GetScreenHeight())
  
  
; fill the backdrop with something so we can see it
  Tile=LoadNewFxImage("..\../Media/bg22.jpg")
  
  
  Col=$108040
  
  ScreenVsync on
  
; Start of Demo loop
  Do
     
     Cls 0
   ; Bump Angle, we'll use to the move the colour in a sine wave
     
     Angle#=WrapAngle(Angle#,1)
     ColourLevel=50+CosRadius(angle#,50)
     Colour=RGBFade(Col,ColourLevel)
     
     
   ; Draw a screen full of scrolling tiles
     RenderToImage MyImage
     TileImage Tile,Xpos,0,false
     RenderToScreen
     Xpos++
     
   ; Do a combined Blit (copy) our Image with Alpha Colour Addition.
   ; This lets us draw the image as is, with a while adding the colour every pixel in the image while it's being
   ; drawn, without changing the image.
     
     BlitImageAlphaAddColour(MyIMage,0,0,Colour)
     
   ; Display Message
     Ink RGB(255,0,0)
     
     Text 0,0,"Using BlitImageAlphaMultImage as a light Map"
     Text 0,20,"Left Mouse to change light colour"
     
     
   ; flip the back buffer to the front, so the user can see it
     Sync
     
  Loop
  
  
 
Related Info: BlitImageAlpha50Colour | BlitImageAlphaMultColour | BlitImageAlphaPostMultColour | BlitImageAlphaSubColour | BlitImageClear | Box | DrawAlphaImage | DrawImage | InkMode :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com